package com.zbf.线程池;

import java.util.Timer;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

/**
 * @author: LI-CI-GAO
 * 作者: licigao
 * 日期: 2021/8/14  11:26
 * 描述: 测试使用 Exectors
 */
public class TestExectors {

    public static int yy=0;

    public static void main(String[] args) throws InterruptedException {

        ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);

        MyRunable01 myRunable=new MyRunable01(scheduledExecutorService);

        scheduledExecutorService.scheduleWithFixedDelay(myRunable,0,3,TimeUnit.SECONDS);


        while (true){
            System.out.println("******yy*****=>"+TestExectors.yy);
            Thread.sleep(200);
        }


    }

}
